using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;
using SJVars;
using Spacejock;
using System;
using System.Collections;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Printing;
using System.Drawing.Text;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Windows.Forms;
using yW5Lib;

namespace yWriter6
{
	[DesignerGenerated]
	internal class frmStoryBoard : Form
	{
		public delegate void ClosedFormEventHandler();

		public delegate void EditSceneEventHandler(int ScID, int WhichTab);

		public enum eSizes
		{
			Small,
			Medium,
			Large
		}

		public enum eShowWhat
		{
			ShowAllChar,
			ShowVPOnly
		}

		private IContainer components;

		[CompilerGenerated]
		[AccessedThroughProperty("picStoryBoard")]
		private PictureBox _picStoryBoard;

		[CompilerGenerated]
		[AccessedThroughProperty("HScrollBar1")]
		private HScrollBar _HScrollBar1;

		[CompilerGenerated]
		[AccessedThroughProperty("VScrollBar1")]
		private VScrollBar _VScrollBar1;

		[CompilerGenerated]
		[AccessedThroughProperty("MenuStrip1")]
		private MenuStrip _MenuStrip1;

		[CompilerGenerated]
		[AccessedThroughProperty("FileToolStripMenuItem")]
		private ToolStripMenuItem _FileToolStripMenuItem;

		[CompilerGenerated]
		[AccessedThroughProperty("PrintToolStripMenuItem")]
		private ToolStripMenuItem _PrintToolStripMenuItem;

		[CompilerGenerated]
		[AccessedThroughProperty("PrintDialog1")]
		private PrintDialog _PrintDialog1;

		[CompilerGenerated]
		[AccessedThroughProperty("PrintDocument1")]
		private PrintDocument _PrintDocument1;

		[CompilerGenerated]
		[AccessedThroughProperty("PageSetupToolStripMenuItem")]
		private ToolStripMenuItem _PageSetupToolStripMenuItem;

		[CompilerGenerated]
		[AccessedThroughProperty("PageSetupDialog1")]
		private PageSetupDialog _PageSetupDialog1;

		[CompilerGenerated]
		[AccessedThroughProperty("HelpToolStripMenuItem")]
		private ToolStripMenuItem _HelpToolStripMenuItem;

		[CompilerGenerated]
		[AccessedThroughProperty("AboutPrintingToolStripMenuItem")]
		private ToolStripMenuItem _AboutPrintingToolStripMenuItem;

		[CompilerGenerated]
		[AccessedThroughProperty("PrintPreviewDialog1")]
		private PrintPreviewDialog _PrintPreviewDialog1;

		[CompilerGenerated]
		[AccessedThroughProperty("PrintPreviewToolStripMenuItem")]
		private ToolStripMenuItem _PrintPreviewToolStripMenuItem;

		[CompilerGenerated]
		[AccessedThroughProperty("EditToolStripMenuItem")]
		private ToolStripMenuItem _EditToolStripMenuItem;

		[CompilerGenerated]
		[AccessedThroughProperty("SelectFontToolStripMenuItem")]
		private ToolStripMenuItem _SelectFontToolStripMenuItem;

		[CompilerGenerated]
		[AccessedThroughProperty("ViewToolStripMenuItem")]
		private ToolStripMenuItem _ViewToolStripMenuItem;

		[CompilerGenerated]
		[AccessedThroughProperty("AllCharactersToolStripMenuItem")]
		private ToolStripMenuItem _AllCharactersToolStripMenuItem;

		[CompilerGenerated]
		[AccessedThroughProperty("ViewpointOnlyToolStripMenuItem")]
		private ToolStripMenuItem _ViewpointOnlyToolStripMenuItem;

		[CompilerGenerated]
		[AccessedThroughProperty("ctxCards")]
		private ContextMenuStrip _ctxCards;

		[CompilerGenerated]
		[AccessedThroughProperty("EditSelectedSceneToolStripMenuItem")]
		private ToolStripMenuItem _EditSelectedSceneToolStripMenuItem;

		[CompilerGenerated]
		[AccessedThroughProperty("StatusStrip1")]
		private StatusStrip _StatusStrip1;

		[CompilerGenerated]
		[AccessedThroughProperty("tssChar")]
		private ToolStripStatusLabel _tssChar;

		[CompilerGenerated]
		[AccessedThroughProperty("tssWordCount")]
		private ToolStripStatusLabel _tssWordCount;

		[CompilerGenerated]
		[AccessedThroughProperty("tssStatus")]
		private ToolStripStatusLabel _tssStatus;

		[CompilerGenerated]
		[AccessedThroughProperty("tssLocations")]
		private ToolStripStatusLabel _tssLocations;

		[CompilerGenerated]
		[AccessedThroughProperty("tssItems")]
		private ToolStripStatusLabel _tssItems;

		[CompilerGenerated]
		[AccessedThroughProperty("ToolStripSeparator1")]
		private ToolStripSeparator _ToolStripSeparator1;

		[CompilerGenerated]
		[AccessedThroughProperty("SmallerToolStripMenuItem")]
		private ToolStripMenuItem _SmallerToolStripMenuItem;

		[CompilerGenerated]
		[AccessedThroughProperty("NormalToolStripMenuItem")]
		private ToolStripMenuItem _NormalToolStripMenuItem;

		[CompilerGenerated]
		[AccessedThroughProperty("LargerToolStripMenuItem")]
		private ToolStripMenuItem _LargerToolStripMenuItem;

		[CompilerGenerated]
		private ClosedFormEventHandler ClosedFormEvent;

		[CompilerGenerated]
		private EditSceneEventHandler EditSceneEvent;

		private int LeftCol;

		private int TopRow;

		private int ColsVisible;

		private int RowsVisible;

		private bool SuppressChange;

		private Font CardFont;

		private int CardWidth;

		private int CardHeight;

		private const int ColGap = 14;

		private const int RowGap = 10;

		private const int LeftMargin = 80;

		private const int TopMargin = 30;

		private const int VPRowHeight = 10;

		private int RowHeight;

		private int ColWidth;

		private Collection colRows;

		private Collection colVPIDs;

		private Collection colSceneIDs;

		private Collection colColours;

		private int PrinterTopRow;

		private int PrinterLeftCol;

		private int PrinterColsVisible;

		private int PrinterRowsVisible;

		private int PrinterHeight;

		private int PrinterWidth;

		private SolidBrush ShadowBrush;

		private clsProject cProject;

		private Rectangle RectCard;

		private Rectangle RectFrame;

		private eSizes CardSize;

		private eShowWhat ShowWhat;

		private int MouseCol;

		private int MouseRow;

		private bool DraggingCard;

		private int DraggingID;

		private int CardXOffset;

		private int CardYOffset;

		internal virtual PictureBox picStoryBoard
		{
			[CompilerGenerated]
			get
			{
				return _picStoryBoard;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = picSB_Click;
				EventHandler value3 = picSB_DoubleClick;
				MouseEventHandler value4 = picSB_MouseClick;
				MouseEventHandler value5 = picSB_MouseDown;
				MouseEventHandler value6 = picSB_MouseMove;
				MouseEventHandler value7 = picSB_MouseUp;
				PictureBox picStoryBoard = _picStoryBoard;
				if (picStoryBoard != null)
				{
					picStoryBoard.Click -= value2;
					picStoryBoard.DoubleClick -= value3;
					picStoryBoard.MouseClick -= value4;
					picStoryBoard.MouseDown -= value5;
					picStoryBoard.MouseMove -= value6;
					picStoryBoard.MouseUp -= value7;
				}
				_picStoryBoard = value;
				picStoryBoard = _picStoryBoard;
				if (picStoryBoard != null)
				{
					picStoryBoard.Click += value2;
					picStoryBoard.DoubleClick += value3;
					picStoryBoard.MouseClick += value4;
					picStoryBoard.MouseDown += value5;
					picStoryBoard.MouseMove += value6;
					picStoryBoard.MouseUp += value7;
				}
			}
		}

		internal virtual HScrollBar HScrollBar1
		{
			[CompilerGenerated]
			get
			{
				return _HScrollBar1;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				ScrollEventHandler value2 = HScrollBar1_Scroll;
				HScrollBar hScrollBar = _HScrollBar1;
				if (hScrollBar != null)
				{
					hScrollBar.Scroll -= value2;
				}
				_HScrollBar1 = value;
				hScrollBar = _HScrollBar1;
				if (hScrollBar != null)
				{
					hScrollBar.Scroll += value2;
				}
			}
		}

		internal virtual VScrollBar VScrollBar1
		{
			[CompilerGenerated]
			get
			{
				return _VScrollBar1;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				ScrollEventHandler value2 = VScrollBar1_Scroll;
				VScrollBar vScrollBar = _VScrollBar1;
				if (vScrollBar != null)
				{
					vScrollBar.Scroll -= value2;
				}
				_VScrollBar1 = value;
				vScrollBar = _VScrollBar1;
				if (vScrollBar != null)
				{
					vScrollBar.Scroll += value2;
				}
			}
		}

		internal virtual MenuStrip MenuStrip1
		{
			[CompilerGenerated]
			get
			{
				return _MenuStrip1;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				ToolStripItemClickedEventHandler value2 = MenuStrip1_ItemClicked;
				MenuStrip menuStrip = _MenuStrip1;
				if (menuStrip != null)
				{
					menuStrip.ItemClicked -= value2;
				}
				_MenuStrip1 = value;
				menuStrip = _MenuStrip1;
				if (menuStrip != null)
				{
					menuStrip.ItemClicked += value2;
				}
			}
		}

		[field: AccessedThroughProperty("FileToolStripMenuItem")]
		internal virtual ToolStripMenuItem FileToolStripMenuItem
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		internal virtual ToolStripMenuItem PrintToolStripMenuItem
		{
			[CompilerGenerated]
			get
			{
				return _PrintToolStripMenuItem;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = PrintToolStripMenuItem_Click;
				ToolStripMenuItem printToolStripMenuItem = _PrintToolStripMenuItem;
				if (printToolStripMenuItem != null)
				{
					printToolStripMenuItem.Click -= value2;
				}
				_PrintToolStripMenuItem = value;
				printToolStripMenuItem = _PrintToolStripMenuItem;
				if (printToolStripMenuItem != null)
				{
					printToolStripMenuItem.Click += value2;
				}
			}
		}

		[field: AccessedThroughProperty("PrintDialog1")]
		internal virtual PrintDialog PrintDialog1
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		internal virtual PrintDocument PrintDocument1
		{
			[CompilerGenerated]
			get
			{
				return _PrintDocument1;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				PrintEventHandler value2 = PrintDocument1_BeginPrint;
				PrintEventHandler value3 = PrintDocument1_EndPrint;
				PrintPageEventHandler value4 = PrintDocument1_PrintPage;
				PrintDocument printDocument = _PrintDocument1;
				if (printDocument != null)
				{
					printDocument.BeginPrint -= value2;
					printDocument.EndPrint -= value3;
					printDocument.PrintPage -= value4;
				}
				_PrintDocument1 = value;
				printDocument = _PrintDocument1;
				if (printDocument != null)
				{
					printDocument.BeginPrint += value2;
					printDocument.EndPrint += value3;
					printDocument.PrintPage += value4;
				}
			}
		}

		internal virtual ToolStripMenuItem PageSetupToolStripMenuItem
		{
			[CompilerGenerated]
			get
			{
				return _PageSetupToolStripMenuItem;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = PageSetupToolStripMenuItem_Click;
				ToolStripMenuItem pageSetupToolStripMenuItem = _PageSetupToolStripMenuItem;
				if (pageSetupToolStripMenuItem != null)
				{
					pageSetupToolStripMenuItem.Click -= value2;
				}
				_PageSetupToolStripMenuItem = value;
				pageSetupToolStripMenuItem = _PageSetupToolStripMenuItem;
				if (pageSetupToolStripMenuItem != null)
				{
					pageSetupToolStripMenuItem.Click += value2;
				}
			}
		}

		[field: AccessedThroughProperty("PageSetupDialog1")]
		internal virtual PageSetupDialog PageSetupDialog1
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("HelpToolStripMenuItem")]
		internal virtual ToolStripMenuItem HelpToolStripMenuItem
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		internal virtual ToolStripMenuItem AboutPrintingToolStripMenuItem
		{
			[CompilerGenerated]
			get
			{
				return _AboutPrintingToolStripMenuItem;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = AboutPrintingToolStripMenuItem_Click;
				ToolStripMenuItem aboutPrintingToolStripMenuItem = _AboutPrintingToolStripMenuItem;
				if (aboutPrintingToolStripMenuItem != null)
				{
					aboutPrintingToolStripMenuItem.Click -= value2;
				}
				_AboutPrintingToolStripMenuItem = value;
				aboutPrintingToolStripMenuItem = _AboutPrintingToolStripMenuItem;
				if (aboutPrintingToolStripMenuItem != null)
				{
					aboutPrintingToolStripMenuItem.Click += value2;
				}
			}
		}

		internal virtual PrintPreviewDialog PrintPreviewDialog1
		{
			[CompilerGenerated]
			get
			{
				return _PrintPreviewDialog1;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = PrintPreviewDialog1_Load;
				PrintPreviewDialog printPreviewDialog = _PrintPreviewDialog1;
				if (printPreviewDialog != null)
				{
					printPreviewDialog.Load -= value2;
				}
				_PrintPreviewDialog1 = value;
				printPreviewDialog = _PrintPreviewDialog1;
				if (printPreviewDialog != null)
				{
					printPreviewDialog.Load += value2;
				}
			}
		}

		internal virtual ToolStripMenuItem PrintPreviewToolStripMenuItem
		{
			[CompilerGenerated]
			get
			{
				return _PrintPreviewToolStripMenuItem;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = PrintPreviewToolStripMenuItem_Click;
				ToolStripMenuItem printPreviewToolStripMenuItem = _PrintPreviewToolStripMenuItem;
				if (printPreviewToolStripMenuItem != null)
				{
					printPreviewToolStripMenuItem.Click -= value2;
				}
				_PrintPreviewToolStripMenuItem = value;
				printPreviewToolStripMenuItem = _PrintPreviewToolStripMenuItem;
				if (printPreviewToolStripMenuItem != null)
				{
					printPreviewToolStripMenuItem.Click += value2;
				}
			}
		}

		[field: AccessedThroughProperty("EditToolStripMenuItem")]
		internal virtual ToolStripMenuItem EditToolStripMenuItem
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		internal virtual ToolStripMenuItem SelectFontToolStripMenuItem
		{
			[CompilerGenerated]
			get
			{
				return _SelectFontToolStripMenuItem;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = SelectFontToolStripMenuItem_Click;
				ToolStripMenuItem selectFontToolStripMenuItem = _SelectFontToolStripMenuItem;
				if (selectFontToolStripMenuItem != null)
				{
					selectFontToolStripMenuItem.Click -= value2;
				}
				_SelectFontToolStripMenuItem = value;
				selectFontToolStripMenuItem = _SelectFontToolStripMenuItem;
				if (selectFontToolStripMenuItem != null)
				{
					selectFontToolStripMenuItem.Click += value2;
				}
			}
		}

		internal virtual ToolStripMenuItem ViewToolStripMenuItem
		{
			[CompilerGenerated]
			get
			{
				return _ViewToolStripMenuItem;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = ViewToolStripMenuItem_Click;
				EventHandler value3 = ViewToolStripMenuItem_DropDownOpening;
				ToolStripMenuItem viewToolStripMenuItem = _ViewToolStripMenuItem;
				if (viewToolStripMenuItem != null)
				{
					viewToolStripMenuItem.Click -= value2;
					viewToolStripMenuItem.DropDownOpening -= value3;
				}
				_ViewToolStripMenuItem = value;
				viewToolStripMenuItem = _ViewToolStripMenuItem;
				if (viewToolStripMenuItem != null)
				{
					viewToolStripMenuItem.Click += value2;
					viewToolStripMenuItem.DropDownOpening += value3;
				}
			}
		}

		internal virtual ToolStripMenuItem AllCharactersToolStripMenuItem
		{
			[CompilerGenerated]
			get
			{
				return _AllCharactersToolStripMenuItem;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = AllCharactersToolStripMenuItem_Click;
				ToolStripMenuItem allCharactersToolStripMenuItem = _AllCharactersToolStripMenuItem;
				if (allCharactersToolStripMenuItem != null)
				{
					allCharactersToolStripMenuItem.Click -= value2;
				}
				_AllCharactersToolStripMenuItem = value;
				allCharactersToolStripMenuItem = _AllCharactersToolStripMenuItem;
				if (allCharactersToolStripMenuItem != null)
				{
					allCharactersToolStripMenuItem.Click += value2;
				}
			}
		}

		internal virtual ToolStripMenuItem ViewpointOnlyToolStripMenuItem
		{
			[CompilerGenerated]
			get
			{
				return _ViewpointOnlyToolStripMenuItem;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = ViewpointOnlyToolStripMenuItem_Click;
				ToolStripMenuItem viewpointOnlyToolStripMenuItem = _ViewpointOnlyToolStripMenuItem;
				if (viewpointOnlyToolStripMenuItem != null)
				{
					viewpointOnlyToolStripMenuItem.Click -= value2;
				}
				_ViewpointOnlyToolStripMenuItem = value;
				viewpointOnlyToolStripMenuItem = _ViewpointOnlyToolStripMenuItem;
				if (viewpointOnlyToolStripMenuItem != null)
				{
					viewpointOnlyToolStripMenuItem.Click += value2;
				}
			}
		}

		internal virtual ContextMenuStrip ctxCards
		{
			[CompilerGenerated]
			get
			{
				return _ctxCards;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				CancelEventHandler value2 = ctxCards_Opening;
				ContextMenuStrip ctxCards = _ctxCards;
				if (ctxCards != null)
				{
					ctxCards.Opening -= value2;
				}
				_ctxCards = value;
				ctxCards = _ctxCards;
				if (ctxCards != null)
				{
					ctxCards.Opening += value2;
				}
			}
		}

		internal virtual ToolStripMenuItem EditSelectedSceneToolStripMenuItem
		{
			[CompilerGenerated]
			get
			{
				return _EditSelectedSceneToolStripMenuItem;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = EditSelectedSceneToolStripMenuItem_Click;
				ToolStripMenuItem editSelectedSceneToolStripMenuItem = _EditSelectedSceneToolStripMenuItem;
				if (editSelectedSceneToolStripMenuItem != null)
				{
					editSelectedSceneToolStripMenuItem.Click -= value2;
				}
				_EditSelectedSceneToolStripMenuItem = value;
				editSelectedSceneToolStripMenuItem = _EditSelectedSceneToolStripMenuItem;
				if (editSelectedSceneToolStripMenuItem != null)
				{
					editSelectedSceneToolStripMenuItem.Click += value2;
				}
			}
		}

		[field: AccessedThroughProperty("StatusStrip1")]
		internal virtual StatusStrip StatusStrip1
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("tssChar")]
		internal virtual ToolStripStatusLabel tssChar
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("tssWordCount")]
		internal virtual ToolStripStatusLabel tssWordCount
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("tssStatus")]
		internal virtual ToolStripStatusLabel tssStatus
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("tssLocations")]
		internal virtual ToolStripStatusLabel tssLocations
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("tssItems")]
		internal virtual ToolStripStatusLabel tssItems
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("ToolStripSeparator1")]
		internal virtual ToolStripSeparator ToolStripSeparator1
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		internal virtual ToolStripMenuItem SmallerToolStripMenuItem
		{
			[CompilerGenerated]
			get
			{
				return _SmallerToolStripMenuItem;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = SmallerToolStripMenuItem_Click;
				ToolStripMenuItem smallerToolStripMenuItem = _SmallerToolStripMenuItem;
				if (smallerToolStripMenuItem != null)
				{
					smallerToolStripMenuItem.Click -= value2;
				}
				_SmallerToolStripMenuItem = value;
				smallerToolStripMenuItem = _SmallerToolStripMenuItem;
				if (smallerToolStripMenuItem != null)
				{
					smallerToolStripMenuItem.Click += value2;
				}
			}
		}

		internal virtual ToolStripMenuItem NormalToolStripMenuItem
		{
			[CompilerGenerated]
			get
			{
				return _NormalToolStripMenuItem;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = NormalToolStripMenuItem_Click;
				ToolStripMenuItem normalToolStripMenuItem = _NormalToolStripMenuItem;
				if (normalToolStripMenuItem != null)
				{
					normalToolStripMenuItem.Click -= value2;
				}
				_NormalToolStripMenuItem = value;
				normalToolStripMenuItem = _NormalToolStripMenuItem;
				if (normalToolStripMenuItem != null)
				{
					normalToolStripMenuItem.Click += value2;
				}
			}
		}

		internal virtual ToolStripMenuItem LargerToolStripMenuItem
		{
			[CompilerGenerated]
			get
			{
				return _LargerToolStripMenuItem;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = LargerToolStripMenuItem_Click;
				ToolStripMenuItem largerToolStripMenuItem = _LargerToolStripMenuItem;
				if (largerToolStripMenuItem != null)
				{
					largerToolStripMenuItem.Click -= value2;
				}
				_LargerToolStripMenuItem = value;
				largerToolStripMenuItem = _LargerToolStripMenuItem;
				if (largerToolStripMenuItem != null)
				{
					largerToolStripMenuItem.Click += value2;
				}
			}
		}

		public event ClosedFormEventHandler ClosedForm
		{
			[CompilerGenerated]
			add
			{
				ClosedFormEventHandler closedFormEventHandler = ClosedFormEvent;
				ClosedFormEventHandler closedFormEventHandler2;
				do
				{
					closedFormEventHandler2 = closedFormEventHandler;
					ClosedFormEventHandler value2 = (ClosedFormEventHandler)Delegate.Combine(closedFormEventHandler2, value);
					closedFormEventHandler = Interlocked.CompareExchange(ref ClosedFormEvent, value2, closedFormEventHandler2);
				}
				while ((object)closedFormEventHandler != closedFormEventHandler2);
			}
			[CompilerGenerated]
			remove
			{
				ClosedFormEventHandler closedFormEventHandler = ClosedFormEvent;
				ClosedFormEventHandler closedFormEventHandler2;
				do
				{
					closedFormEventHandler2 = closedFormEventHandler;
					ClosedFormEventHandler value2 = (ClosedFormEventHandler)Delegate.Remove(closedFormEventHandler2, value);
					closedFormEventHandler = Interlocked.CompareExchange(ref ClosedFormEvent, value2, closedFormEventHandler2);
				}
				while ((object)closedFormEventHandler != closedFormEventHandler2);
			}
		}

		public event EditSceneEventHandler EditScene
		{
			[CompilerGenerated]
			add
			{
				EditSceneEventHandler editSceneEventHandler = EditSceneEvent;
				EditSceneEventHandler editSceneEventHandler2;
				do
				{
					editSceneEventHandler2 = editSceneEventHandler;
					EditSceneEventHandler value2 = (EditSceneEventHandler)Delegate.Combine(editSceneEventHandler2, value);
					editSceneEventHandler = Interlocked.CompareExchange(ref EditSceneEvent, value2, editSceneEventHandler2);
				}
				while ((object)editSceneEventHandler != editSceneEventHandler2);
			}
			[CompilerGenerated]
			remove
			{
				EditSceneEventHandler editSceneEventHandler = EditSceneEvent;
				EditSceneEventHandler editSceneEventHandler2;
				do
				{
					editSceneEventHandler2 = editSceneEventHandler;
					EditSceneEventHandler value2 = (EditSceneEventHandler)Delegate.Remove(editSceneEventHandler2, value);
					editSceneEventHandler = Interlocked.CompareExchange(ref EditSceneEvent, value2, editSceneEventHandler2);
				}
				while ((object)editSceneEventHandler != editSceneEventHandler2);
			}
		}

		[DebuggerNonUserCode]
		protected override void Dispose(bool Disposing)
		{
			if (Disposing && components != null)
			{
				components.Dispose();
			}
			base.Dispose(Disposing);
		}

		[System.Diagnostics.DebuggerStepThrough]
		private void InitializeComponent()
		{
			components = new System.ComponentModel.Container();
			System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(yWriter6.frmStoryBoard));
			picStoryBoard = new System.Windows.Forms.PictureBox();
			ctxCards = new System.Windows.Forms.ContextMenuStrip(components);
			EditSelectedSceneToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			HScrollBar1 = new System.Windows.Forms.HScrollBar();
			VScrollBar1 = new System.Windows.Forms.VScrollBar();
			MenuStrip1 = new System.Windows.Forms.MenuStrip();
			FileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			PageSetupToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			PrintToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			PrintPreviewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			EditToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			SelectFontToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			ViewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			AllCharactersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			ViewpointOnlyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			ToolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
			SmallerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			NormalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			LargerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			HelpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			AboutPrintingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			PrintDialog1 = new System.Windows.Forms.PrintDialog();
			PrintDocument1 = new System.Drawing.Printing.PrintDocument();
			PageSetupDialog1 = new System.Windows.Forms.PageSetupDialog();
			PrintPreviewDialog1 = new System.Windows.Forms.PrintPreviewDialog();
			StatusStrip1 = new System.Windows.Forms.StatusStrip();
			tssChar = new System.Windows.Forms.ToolStripStatusLabel();
			tssLocations = new System.Windows.Forms.ToolStripStatusLabel();
			tssItems = new System.Windows.Forms.ToolStripStatusLabel();
			tssWordCount = new System.Windows.Forms.ToolStripStatusLabel();
			tssStatus = new System.Windows.Forms.ToolStripStatusLabel();
			((System.ComponentModel.ISupportInitialize)picStoryBoard).BeginInit();
			ctxCards.SuspendLayout();
			MenuStrip1.SuspendLayout();
			StatusStrip1.SuspendLayout();
			SuspendLayout();
			picStoryBoard.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right);
			picStoryBoard.BackColor = System.Drawing.SystemColors.Window;
			picStoryBoard.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
			picStoryBoard.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			picStoryBoard.ContextMenuStrip = ctxCards;
			picStoryBoard.Location = new System.Drawing.Point(11, 34);
			picStoryBoard.Name = "picStoryBoard";
			picStoryBoard.Size = new System.Drawing.Size(700, 371);
			picStoryBoard.TabIndex = 0;
			picStoryBoard.TabStop = false;
			ctxCards.Items.AddRange(new System.Windows.Forms.ToolStripItem[1]
			{
				EditSelectedSceneToolStripMenuItem
			});
			ctxCards.Name = "ctxCards";
			ctxCards.Size = new System.Drawing.Size(209, 28);
			EditSelectedSceneToolStripMenuItem.Name = "EditSelectedSceneToolStripMenuItem";
			EditSelectedSceneToolStripMenuItem.Size = new System.Drawing.Size(208, 24);
			EditSelectedSceneToolStripMenuItem.Text = "Edit Selected Scene";
			HScrollBar1.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right);
			HScrollBar1.Location = new System.Drawing.Point(11, 408);
			HScrollBar1.Name = "HScrollBar1";
			HScrollBar1.Size = new System.Drawing.Size(700, 21);
			HScrollBar1.TabIndex = 1;
			VScrollBar1.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right);
			VScrollBar1.Location = new System.Drawing.Point(717, 34);
			VScrollBar1.Name = "VScrollBar1";
			VScrollBar1.Size = new System.Drawing.Size(21, 371);
			VScrollBar1.TabIndex = 2;
			MenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[4]
			{
				FileToolStripMenuItem,
				EditToolStripMenuItem,
				ViewToolStripMenuItem,
				HelpToolStripMenuItem
			});
			MenuStrip1.Location = new System.Drawing.Point(0, 0);
			MenuStrip1.Name = "MenuStrip1";
			MenuStrip1.Size = new System.Drawing.Size(747, 28);
			MenuStrip1.TabIndex = 3;
			MenuStrip1.Text = "MenuStrip1";
			FileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[3]
			{
				PageSetupToolStripMenuItem,
				PrintToolStripMenuItem,
				PrintPreviewToolStripMenuItem
			});
			FileToolStripMenuItem.Name = "FileToolStripMenuItem";
			FileToolStripMenuItem.Size = new System.Drawing.Size(44, 24);
			FileToolStripMenuItem.Text = "File";
			PageSetupToolStripMenuItem.Name = "PageSetupToolStripMenuItem";
			PageSetupToolStripMenuItem.Size = new System.Drawing.Size(163, 24);
			PageSetupToolStripMenuItem.Text = "Page Setup";
			PrintToolStripMenuItem.Name = "PrintToolStripMenuItem";
			PrintToolStripMenuItem.Size = new System.Drawing.Size(163, 24);
			PrintToolStripMenuItem.Text = "Print";
			PrintToolStripMenuItem.ToolTipText = "WARNING - this can use a LOT of paper";
			PrintPreviewToolStripMenuItem.Name = "PrintPreviewToolStripMenuItem";
			PrintPreviewToolStripMenuItem.Size = new System.Drawing.Size(163, 24);
			PrintPreviewToolStripMenuItem.Text = "Print Preview";
			EditToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[1]
			{
				SelectFontToolStripMenuItem
			});
			EditToolStripMenuItem.Name = "EditToolStripMenuItem";
			EditToolStripMenuItem.Size = new System.Drawing.Size(47, 24);
			EditToolStripMenuItem.Text = "Edit";
			SelectFontToolStripMenuItem.Name = "SelectFontToolStripMenuItem";
			SelectFontToolStripMenuItem.Size = new System.Drawing.Size(151, 24);
			SelectFontToolStripMenuItem.Text = "Select Font";
			ViewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[6]
			{
				AllCharactersToolStripMenuItem,
				ViewpointOnlyToolStripMenuItem,
				ToolStripSeparator1,
				SmallerToolStripMenuItem,
				NormalToolStripMenuItem,
				LargerToolStripMenuItem
			});
			ViewToolStripMenuItem.Name = "ViewToolStripMenuItem";
			ViewToolStripMenuItem.Size = new System.Drawing.Size(53, 24);
			ViewToolStripMenuItem.Text = "View";
			AllCharactersToolStripMenuItem.Checked = true;
			AllCharactersToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
			AllCharactersToolStripMenuItem.Name = "AllCharactersToolStripMenuItem";
			AllCharactersToolStripMenuItem.Size = new System.Drawing.Size(252, 24);
			AllCharactersToolStripMenuItem.Text = "All Characters";
			ViewpointOnlyToolStripMenuItem.Name = "ViewpointOnlyToolStripMenuItem";
			ViewpointOnlyToolStripMenuItem.Size = new System.Drawing.Size(252, 24);
			ViewpointOnlyToolStripMenuItem.Text = "Viewpoint Characters Only";
			ToolStripSeparator1.Name = "ToolStripSeparator1";
			ToolStripSeparator1.Size = new System.Drawing.Size(249, 6);
			SmallerToolStripMenuItem.Name = "SmallerToolStripMenuItem";
			SmallerToolStripMenuItem.Size = new System.Drawing.Size(252, 24);
			SmallerToolStripMenuItem.Text = "Small";
			NormalToolStripMenuItem.Name = "NormalToolStripMenuItem";
			NormalToolStripMenuItem.Size = new System.Drawing.Size(252, 24);
			NormalToolStripMenuItem.Text = "Normal";
			LargerToolStripMenuItem.Name = "LargerToolStripMenuItem";
			LargerToolStripMenuItem.Size = new System.Drawing.Size(252, 24);
			LargerToolStripMenuItem.Text = "Large";
			HelpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[1]
			{
				AboutPrintingToolStripMenuItem
			});
			HelpToolStripMenuItem.Name = "HelpToolStripMenuItem";
			HelpToolStripMenuItem.Size = new System.Drawing.Size(53, 24);
			HelpToolStripMenuItem.Text = "Help";
			AboutPrintingToolStripMenuItem.Name = "AboutPrintingToolStripMenuItem";
			AboutPrintingToolStripMenuItem.Size = new System.Drawing.Size(174, 24);
			AboutPrintingToolStripMenuItem.Text = "About Printing";
			PrintDialog1.Document = PrintDocument1;
			PrintDialog1.UseEXDialog = true;
			PageSetupDialog1.Document = PrintDocument1;
			PrintPreviewDialog1.AutoScrollMargin = new System.Drawing.Size(0, 0);
			PrintPreviewDialog1.AutoScrollMinSize = new System.Drawing.Size(0, 0);
			PrintPreviewDialog1.ClientSize = new System.Drawing.Size(400, 300);
			PrintPreviewDialog1.Document = PrintDocument1;
			PrintPreviewDialog1.Enabled = true;
			PrintPreviewDialog1.Icon = (System.Drawing.Icon)resources.GetObject("PrintPreviewDialog1.Icon");
			PrintPreviewDialog1.MainMenuStrip = MenuStrip1;
			PrintPreviewDialog1.Name = "PrintPreviewDialog1";
			PrintPreviewDialog1.Visible = false;
			StatusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[5]
			{
				tssChar,
				tssLocations,
				tssItems,
				tssWordCount,
				tssStatus
			});
			StatusStrip1.Location = new System.Drawing.Point(0, 431);
			StatusStrip1.Name = "StatusStrip1";
			StatusStrip1.Size = new System.Drawing.Size(747, 29);
			StatusStrip1.TabIndex = 5;
			StatusStrip1.Text = "StatusStrip1";
			tssChar.BorderSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Right;
			tssChar.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
			tssChar.Name = "tssChar";
			tssChar.Size = new System.Drawing.Size(29, 24);
			tssChar.Text = "    ";
			tssChar.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			tssLocations.BorderSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Right;
			tssLocations.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
			tssLocations.Name = "tssLocations";
			tssLocations.Size = new System.Drawing.Size(25, 24);
			tssLocations.Text = "   ";
			tssItems.BorderSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Right;
			tssItems.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
			tssItems.Name = "tssItems";
			tssItems.Size = new System.Drawing.Size(25, 24);
			tssItems.Text = "   ";
			tssWordCount.BorderSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Right;
			tssWordCount.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
			tssWordCount.Name = "tssWordCount";
			tssWordCount.Size = new System.Drawing.Size(29, 24);
			tssWordCount.Text = "    ";
			tssStatus.BorderSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Right;
			tssStatus.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
			tssStatus.Font = new System.Drawing.Font("Tahoma", 7.8f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0);
			tssStatus.Name = "tssStatus";
			tssStatus.Size = new System.Drawing.Size(32, 24);
			tssStatus.Text = "     ";
			base.AutoScaleDimensions = new System.Drawing.SizeF(8f, 16f);
			base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			base.ClientSize = new System.Drawing.Size(747, 460);
			base.Controls.Add(picStoryBoard);
			base.Controls.Add(VScrollBar1);
			base.Controls.Add(MenuStrip1);
			base.Controls.Add(HScrollBar1);
			base.Controls.Add(StatusStrip1);
			DoubleBuffered = true;
			base.Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon");
			base.MainMenuStrip = MenuStrip1;
			MinimumSize = new System.Drawing.Size(520, 342);
			base.Name = "frmStoryBoard";
			Text = "StoryBoard";
			((System.ComponentModel.ISupportInitialize)picStoryBoard).EndInit();
			ctxCards.ResumeLayout(false);
			MenuStrip1.ResumeLayout(false);
			MenuStrip1.PerformLayout();
			StatusStrip1.ResumeLayout(false);
			StatusStrip1.PerformLayout();
			ResumeLayout(false);
			PerformLayout();
		}

		public frmStoryBoard(ref clsProject ProjectClass)
		{
			base.ClientSizeChanged += frmNewSB_ClientSizeChanged;
			base.FormClosed += frmNewSB_FormClosed;
			base.FormClosing += frmNewSB_FormClosing;
			base.Load += frmNewSB_Load;
			LeftCol = 1;
			TopRow = 1;
			SuppressChange = true;
			CardWidth = 150;
			CardHeight = 120;
			RowHeight = CardHeight + 10;
			ColWidth = CardWidth + 14;
			colRows = new Collection();
			colVPIDs = new Collection();
			colSceneIDs = new Collection();
			colColours = new Collection();
			ShadowBrush = new SolidBrush(Color.FromArgb(48, 0, 0, 0));
			RectCard = new Rectangle(0, 0, CardWidth, CardHeight);
			RectFrame = new Rectangle(0, 0, CardWidth, CardHeight);
			CardSize = eSizes.Medium;
			CardXOffset = 0;
			CardYOffset = 0;
			InitializeComponent();
			SuppressChange = true;
			cProject = ProjectClass;
			SuppressChange = false;
			try
			{
				cProject.AddedNewScene += cProject_AddedNewScene;
				cProject.AddedNewChar += cProject_UpdatedChar;
				cProject.AddedNewChapter += cProject_AddedNewChapter;
				cProject.RemovedChar += cProject_UpdatedChar;
				cProject.SavedScene += cProject_SavedScene;
				cProject.SavedChar += cProject_SavedChar;
				cProject.SavedChapter += cProject_SavedChapter;
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
				ProjectData.ClearProjectError();
			}
		}

		private void Setup()
		{
			SetupFont();
			SetupColours();
			FillVPIDs();
			FillSceneIDs();
			try
			{
				ColsVisible = (int)Math.Round((double)(picStoryBoard.Width - 80) / (double)ColWidth);
				RowsVisible = (int)Math.Round((double)(picStoryBoard.Height - 30) / (double)RowHeight);
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
				ProjectData.ClearProjectError();
			}
			SetupScrollbars();
		}

		private void DrawStoryboardOnScreen()
		{
			if (base.WindowState != FormWindowState.Minimized)
			{
				try
				{
					Bitmap B = new Bitmap(picStoryBoard.ClientSize.Width, picStoryBoard.ClientSize.Height);
					Graphics G = Graphics.FromImage(B);
					G.CompositingQuality = CompositingQuality.GammaCorrected;
					G.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit;
					if (TopRow > colRows.Count)
					{
						TopRow = 1;
					}
					if (LeftCol > colSceneIDs.Count)
					{
						LeftCol = 1;
					}
					DrawStoryboard(ref B, ref G, RowsVisible, ColsVisible, TopRow, LeftCol);
					picStoryBoard.Image = B;
					G.Dispose();
					cDelay.DoEvents();
				}
				catch (Exception ex)
				{
					ProjectData.SetProjectError(ex);
					Exception ex2 = ex;
					clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
					ProjectData.ClearProjectError();
				}
			}
		}

		private void DrawStoryboard(ref Bitmap B, ref Graphics G, int RowsVisible, int ColsVisible, int TopRow, int LeftCol)
		{
			try
			{
				Rectangle rect = new Rectangle(0, 0, B.Width, 10);
				for (int i = 1; i <= RowsVisible; i++)
				{
					int num = i + TopRow - 1;
					if (num > colRows.Count)
					{
						break;
					}
					object obj = colColours[num];
					SolidBrush brush = new SolidBrush((obj != null) ? ((Color)obj) : default(Color));
					rect.X = 80;
					rect.Y = (int)Math.Round((double)(i * RowHeight) - (double)RowHeight / 2.0 + 30.0);
					G.FillRectangle(brush, rect);
					int num2 = Conversions.ToInteger(colVPIDs[num]);
					string s = (num2 != 0) ? cProject.get_CharByID(num2).Title : "NONE";
					float x = 2f;
					float y = (int)Math.Round((double)(i * RowHeight) - (double)RowHeight / 2.0 + 30.0 - (double)CardFont.Height / 2.0);
					G.DrawString(s, CardFont, brush, x, y);
				}
				Pen pen = new Pen(SystemColors.WindowText);
				pen.DashStyle = DashStyle.Dash;
				int belongsToChID = default(int);
				int num4 = default(int);
				int num6 = default(int);
				for (int i = 1; i <= ColsVisible; i++)
				{
					int num3 = LeftCol + i - 1;
					if (colSceneIDs.Count >= num3)
					{
						clsScene clsScene = cProject.get_SceneByID(Conversions.ToInteger(colSceneIDs[num3]));
						float x;
						if (clsScene.BelongsToChID != belongsToChID)
						{
							num4++;
							belongsToChID = clsScene.BelongsToChID;
							clsChapter clsChapter = cProject.get_ChapterByID(belongsToChID);
							string title = clsChapter.Title;
							if (TopRow == 1)
							{
								int num5 = (int)Math.Round(G.MeasureString(title, CardFont).Width + 4f);
								num6 = (int)Math.Round(G.MeasureString(title, CardFont).Height + 4f);
								x = (float)((double)((i - 1) * ColWidth + 80) - (double)num5 / 2.0);
								RectFrame.X = (int)Math.Round(x);
								RectFrame.Y = 2;
								RectFrame.Width = num5;
								RectFrame.Height = num6;
								if (clsChapter.Type == ChapterTypes.ChapterNotes)
								{
									G.DrawRectangle(Pens.LightBlue, RectFrame);
								}
								else if (clsChapter.Unused)
								{
									G.DrawRectangle(Pens.LightGray, RectFrame);
								}
								else
								{
									G.DrawRectangle(Pens.Black, RectFrame);
								}
								G.DrawString(title, CardFont, SystemBrushes.WindowText, x + 4f, 4f);
							}
							x = (float)((double)((i - 1) * ColWidth + 14 + 80) - 7.0);
							if (TopRow == 1)
							{
								G.DrawLine(pen, x, num6 + 2, x, B.Height);
							}
							else
							{
								G.DrawLine(pen, x, 0f, x, B.Height);
							}
						}
						int num7 = (clsScene.ViewPointID <= 0) ? 1 : (Conversions.ToInteger(colRows[Conversions.ToString(clsScene.ViewPointID)]) - TopRow + 1);
						x = (i - 1) * ColWidth + 14 + 80;
						float y = (num7 - 1) * RowHeight + 10 + 30;
						DrawCard(ref G, (int)Math.Round(x), (int)Math.Round(y), clsScene);
					}
				}
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
				ProjectData.ClearProjectError();
			}
		}

		private void DrawCard(ref Graphics G, int X, int Y, clsScene Scene)
		{
			try
			{
				RectCard.X = X + 4;
				RectCard.Y = Y + 4;
				RectCard.Width = CardWidth;
				RectCard.Height = CardHeight;
				G.FillRectangle(ShadowBrush, RectCard);
				RectCard.X = X;
				RectCard.Y = Y;
				RectCard.Width = CardWidth;
				RectCard.Height = CardHeight;
				G.FillRectangle(Brushes.LightYellow, RectCard);
				RectFrame.X = X;
				RectFrame.Y = Y;
				RectFrame.Width = CardWidth;
				RectFrame.Height = CardHeight;
				if (Scene.Unused)
				{
					G.DrawRectangle(Pens.LightGray, RectFrame);
				}
				else
				{
					G.DrawRectangle(Pens.Black, RectFrame);
				}
				int num = 2;
				int num2 = 2;
				_ = Scene.ViewPointID;
				string title = Scene.Title;
				int num3 = CardHeight - 2;
				int num4 = CardWidth - 2;
				Bitmap image = new Bitmap(num4, num3);
				Graphics graphics = Graphics.FromImage(image);
				graphics.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit;
				graphics.MeasureString(title, CardFont);
				_ = (int)Math.Round((double)num3 / (double)CardFont.Height);
				RectangleF layoutRectangle = new RectangleF(num, num2, num4, num3);
				StringFormat stringFormat = new StringFormat(StringFormatFlags.MeasureTrailingSpaces | StringFormatFlags.LineLimit);
				graphics.MeasureString(title, CardFont, new SizeF(num4, num3), stringFormat, out int _, out int _);
				if (Scene.Unused)
				{
					graphics.DrawString(title, CardFont, Brushes.LightGray, layoutRectangle, stringFormat);
				}
				else
				{
					graphics.DrawString(title, CardFont, Brushes.Black, layoutRectangle, stringFormat);
				}
				G.DrawImage(image, X + 1, Y + 1);
				graphics.Dispose();
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
				ProjectData.ClearProjectError();
			}
		}

		private void frmNewSB_ClientSizeChanged(object sender, EventArgs e)
		{
			if (!SuppressChange)
			{
				RefreshStoryboard();
			}
		}

		private void frmNewSB_FormClosed(object sender, FormClosedEventArgs e)
		{
			if (e.CloseReason == CloseReason.UserClosing)
			{
				ClosedFormEvent?.Invoke();
			}
			try
			{
				cProject.AddedNewScene -= cProject_AddedNewScene;
				cProject.AddedNewChar -= cProject_UpdatedChar;
				cProject.AddedNewChapter -= cProject_AddedNewChapter;
				cProject.RemovedChar -= cProject_UpdatedChar;
				cProject.SavedScene -= cProject_SavedScene;
				cProject.SavedChar -= cProject_SavedChar;
				cProject.SavedChapter -= cProject_SavedChapter;
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
				ProjectData.ClearProjectError();
			}
		}

		private void frmNewSB_FormClosing(object sender, FormClosingEventArgs e)
		{
			clsShared.cSettings.StoreWindowSettings("StoryBoard5", this);
		}

		private void frmNewSB_Load(object sender, EventArgs e)
		{
			clsSettings cSettings = clsShared.cSettings;
			Form Form = this;
			cSettings.ReadWindowSettings("StoryBoard5", ref Form);
			CardSize = (eSizes)Math.Round(clsShared.cSettings.sGet("CardSize", 1));
			TopRow = 1;
			LeftCol = 1;
			RefreshStoryboard();
		}

		private void FillVPIDs()
		{
			int num = 0;
			try
			{
				colRows.Clear();
				colVPIDs.Clear();
				num++;
				colRows.Add(0);
				colVPIDs.Add(0);
				IEnumerator enumerator = default(IEnumerator);
				try
				{
					enumerator = cProject.Chars.GetEnumerator();
					while (enumerator.MoveNext())
					{
						clsCharacter clsCharacter = (clsCharacter)enumerator.Current;
						bool flag = false;
						switch (ShowWhat)
						{
						case eShowWhat.ShowAllChar:
							flag = true;
							break;
						case eShowWhat.ShowVPOnly:
							if (cProject.IsViewpointSomewhere(clsCharacter.ID))
							{
								flag = true;
							}
							break;
						}
						if (flag)
						{
							num++;
							colRows.Add(num, Conversions.ToString(clsCharacter.ID));
							colVPIDs.Add(clsCharacter.ID, Conversions.ToString(num));
						}
					}
				}
				finally
				{
					if (enumerator is IDisposable)
					{
						(enumerator as IDisposable).Dispose();
					}
				}
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
				ProjectData.ClearProjectError();
			}
		}

		private void FillSceneIDs()
		{
			colSceneIDs.Clear();
			try
			{
				IEnumerator enumerator = default(IEnumerator);
				try
				{
					enumerator = cProject.Chapters.GetEnumerator();
					while (enumerator.MoveNext())
					{
						clsChapter clsChapter = (clsChapter)enumerator.Current;
						int sceneCount = clsChapter.SceneCount;
						for (int i = 1; i <= sceneCount; i++)
						{
							int num = clsChapter.get_SceneIDByIndex(i);
							colSceneIDs.Add(num, Conversions.ToString(num));
						}
					}
				}
				finally
				{
					if (enumerator is IDisposable)
					{
						(enumerator as IDisposable).Dispose();
					}
				}
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
				ProjectData.ClearProjectError();
			}
		}

		public void RefreshStoryboard()
		{
			if (!SuppressChange)
			{
				try
				{
					SuppressChange = true;
					Setup();
					DrawStoryboardOnScreen();
					SuppressChange = false;
				}
				catch (Exception ex)
				{
					ProjectData.SetProjectError(ex);
					Exception ex2 = ex;
					clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
					ProjectData.ClearProjectError();
				}
			}
		}

		private void SetupScrollbars()
		{
			if (base.WindowState != FormWindowState.Minimized)
			{
				try
				{
					VScrollBar1.Minimum = 1;
					HScrollBar1.Minimum = 1;
					int num = colRows.Count;
					if (num < 0)
					{
						num = 0;
					}
					VScrollBar1.Maximum = num;
					if (num == 0)
					{
						VScrollBar1.SmallChange = 0;
						VScrollBar1.LargeChange = 0;
					}
					else
					{
						VScrollBar1.SmallChange = 1;
						VScrollBar1.LargeChange = RowsVisible - 1;
					}
					num = colSceneIDs.Count;
					if (num < 0)
					{
						num = 0;
					}
					HScrollBar1.Maximum = num;
					if (num == 0)
					{
						HScrollBar1.SmallChange = 0;
						HScrollBar1.LargeChange = 0;
					}
					else
					{
						HScrollBar1.SmallChange = 1;
						HScrollBar1.LargeChange = ColsVisible - 1;
					}
					if (colRows.Count < RowsVisible)
					{
						VScrollBar1.Enabled = false;
					}
					else
					{
						VScrollBar1.Enabled = true;
					}
					if (colSceneIDs.Count < ColsVisible)
					{
						HScrollBar1.Enabled = false;
					}
					else
					{
						HScrollBar1.Enabled = true;
					}
				}
				catch (Exception ex)
				{
					ProjectData.SetProjectError(ex);
					Exception ex2 = ex;
					clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
					ProjectData.ClearProjectError();
				}
			}
		}

		private void SetupColours()
		{
			colColours.Clear();
			try
			{
				int charCount = cProject.CharCount;
				for (int i = 1; i <= charCount; i++)
				{
					colColours.Add(cColours.BlueInk);
					colColours.Add(cColours.DarkRedInk);
					colColours.Add(cColours.PurpleInk);
					colColours.Add(cColours.DarkGreenInk);
					colColours.Add(cColours.OrangeInk);
					colColours.Add(cColours.PinkInk);
					colColours.Add(cColours.GreenInk);
					colColours.Add(cColours.BrownInk);
					colColours.Add(cColours.YellowInk);
					colColours.Add(cColours.LightBlueInk);
					colColours.Add(cColours.RedInk);
					if (colColours.Count > cProject.CharCount)
					{
						break;
					}
				}
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
				ProjectData.ClearProjectError();
			}
		}

		private void HScrollBar1_Scroll(object sender, ScrollEventArgs e)
		{
			LeftCol = e.NewValue;
			DrawStoryboardOnScreen();
		}

		private void VScrollBar1_Scroll(object sender, ScrollEventArgs e)
		{
			TopRow = e.NewValue;
			DrawStoryboardOnScreen();
		}

		private void picSB_Click(object sender, EventArgs e)
		{
		}

		private void picSB_DoubleClick(object sender, EventArgs e)
		{
			try
			{
				int num = LeftCol + MouseCol - 1;
				if ((num > 0) & (num <= colSceneIDs.Count))
				{
					EditSceneEvent?.Invoke(Conversions.ToInteger(colSceneIDs[num]), 0);
				}
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
				ProjectData.ClearProjectError();
			}
		}

		private void picSB_MouseClick(object sender, MouseEventArgs e)
		{
		}

		private void picSB_MouseDown(object sender, MouseEventArgs e)
		{
			if (e.Button == MouseButtons.Left && !DraggingCard)
			{
				try
				{
					XYToColRow(e.X, e.Y, ref MouseCol, ref MouseRow);
					DraggingID = SceneIDUnderMouse();
					if (DraggingID > 0)
					{
						DraggingCard = true;
						Bitmap bitmap = new Bitmap(CardWidth + 4, CardHeight + 4);
						Graphics G = Graphics.FromImage(bitmap);
						DrawCard(ref G, 0, 0, cProject.get_SceneByID(DraggingID));
						Cursor cursor = new Cursor(bitmap.GetHicon());
						picStoryBoard.Cursor = cursor;
						G.Dispose();
						float num = (MouseCol - 1) * ColWidth + 14 + 80;
						float num2 = (MouseRow - 1) * RowHeight + 30 + 10;
						G = Graphics.FromImage(picStoryBoard.Image);
						RectCard.X = (int)Math.Round(num);
						RectCard.Y = (int)Math.Round(num2);
						G.FillRectangle(ShadowBrush, RectCard);
						picStoryBoard.Image = bitmap;
						G.Dispose();
						CardXOffset = e.X;
						CardYOffset = e.Y;
					}
				}
				catch (Exception ex)
				{
					ProjectData.SetProjectError(ex);
					Exception ex2 = ex;
					clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
					ProjectData.ClearProjectError();
				}
			}
		}

		private void picSB_MouseMove(object sender, MouseEventArgs e)
		{
			XYToColRow(e.X, e.Y, ref MouseCol, ref MouseRow);
			if (!DraggingCard)
			{
				int num = SceneIDUnderMouse();
				try
				{
					if (num > 0)
					{
						clsScene clsScene = cProject.get_SceneByID(num);
						tssChar.Text = clsShared.cLang.GetTranslation("Characters", ": " + cProject.CharacterList(num, ", "));
						tssLocations.Text = clsShared.cLang.GetTranslation("Locations", ": " + cProject.LocationList(num, ", "));
						tssItems.Text = clsShared.cLang.GetTranslation("Items", ": " + cProject.ItemList(num, ", "));
						tssWordCount.Text = clsShared.cLang.GetTranslation("Words", ": " + Conversions.ToString(clsScene.Wordcount));
						tssStatus.Text = clsShared.cLang.GetTranslation(modVariables.StatusNames[clsScene.Status]);
						tssStatus.ForeColor = modVariables.StatusColours[clsScene.Status];
					}
					else
					{
						tssChar.Text = "";
					}
				}
				catch (Exception ex)
				{
					ProjectData.SetProjectError(ex);
					Exception ex2 = ex;
					ProjectData.ClearProjectError();
				}
			}
		}

		private void XYToColRow(float X, float Y, ref int Col, ref int Row)
		{
			try
			{
				Col = (int)Math.Round(X / (float)ColWidth);
				Row = (int)Math.Round(((double)Y + (double)RowHeight / 2.0 - 30.0) / (double)RowHeight);
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
				ProjectData.ClearProjectError();
			}
		}

		private void cProject_SavedChapter(int ID)
		{
			RefreshStoryboard();
		}

		private void cProject_SavedChar(int ID)
		{
			RefreshStoryboard();
		}

		private void cProject_SavedScene(int ID)
		{
			RefreshStoryboard();
		}

		private void cProject_UpdatedChar(int ID)
		{
			RefreshStoryboard();
		}

		private void cProject_AddedNewScene(int ID)
		{
			RefreshStoryboard();
		}

		private void cProject_AddedNewChapter(int ID)
		{
			RefreshStoryboard();
		}

		private int SceneIDUnderMouse()
		{
			int num = LeftCol + MouseCol - 1;
			if ((num > 0) & (num <= colSceneIDs.Count))
			{
				return Conversions.ToInteger(colSceneIDs[num]);
			}
			return -1;
		}

		private void picSB_MouseUp(object sender, MouseEventArgs e)
		{
			try
			{
				if (DraggingCard)
				{
					DraggingCard = false;
					picStoryBoard.Cursor = Cursors.Default;
					int num = MouseRow + TopRow - 1;
					int num2 = MouseCol + LeftCol - 1;
					if ((num < 1) | (num > colRows.Count))
					{
						RefreshStoryboard();
					}
					else if ((num2 < 1) | (num2 > colSceneIDs.Count))
					{
						RefreshStoryboard();
					}
					else
					{
						int num3 = SceneIDUnderMouse();
						clsScene clsScene = cProject.get_SceneByID(DraggingID);
						if (clsScene.ViewPointID != Conversions.ToInteger(colVPIDs[num]))
						{
							clsScene.SetViewpointByID(Conversions.ToInteger(colVPIDs[num]));
						}
						if (DraggingID == num3)
						{
							clsScene.TriggerSaveEvent();
						}
						else
						{
							int belongsToChID = clsScene.BelongsToChID;
							int belongsToChID2 = cProject.get_SceneByID(num3).BelongsToChID;
							int num4 = cProject.get_ChapterByID(belongsToChID2).SceneIndex(num3);
							if (num4 > 0)
							{
								cProject.get_ChapterByID(belongsToChID).RemoveSceneByID(DraggingID);
								clsScene.BelongsToChID = belongsToChID2;
								cProject.get_ChapterByID(belongsToChID2).InsertSceneIDBeforeIndex(DraggingID, num4);
								if (belongsToChID != belongsToChID2)
								{
									SuppressChange = true;
									cProject.get_ChapterByID(belongsToChID).TriggerSaveEvent();
									SuppressChange = false;
								}
								cProject.get_ChapterByID(belongsToChID2).TriggerSaveEvent();
							}
							else
							{
								clsShared.cLog.AddAction("Tried to move scene in storyboard, but scene we dropped on wasn't present in chapter we dropped on. Odd.");
							}
						}
					}
				}
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
				ProjectData.ClearProjectError();
			}
		}

		private void PrintToolStripMenuItem_Click(object sender, EventArgs e)
		{
			try
			{
				PrintDialog1.PrinterSettings.DefaultPageSettings.Landscape = true;
				if (PrintDialog1.ShowDialog() == DialogResult.OK)
				{
					PrintDocument1.PrinterSettings = PrintDialog1.PrinterSettings;
					PrintDocument1.DocumentName = "Storyboard for " + cProject.Title;
					PrintDocument1.Print();
				}
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
				ProjectData.ClearProjectError();
			}
		}

		private void PrintDocument1_BeginPrint(object sender, PrintEventArgs e)
		{
			PrintToolStripMenuItem.Enabled = false;
			PageSetupToolStripMenuItem.Enabled = false;
			try
			{
				PrinterTopRow = 1;
				PrinterLeftCol = 1;
				PrintDocument1.OriginAtMargins = true;
				clsShared.cSubs.BusyMouse();
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
				ProjectData.ClearProjectError();
			}
		}

		private void PrintDocument1_EndPrint(object sender, PrintEventArgs e)
		{
			try
			{
				PrintToolStripMenuItem.Enabled = true;
				PageSetupToolStripMenuItem.Enabled = true;
				clsShared.cSubs.NormalMouse();
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
				ProjectData.ClearProjectError();
			}
		}

		private void PrintDocument1_PrintPage(object sender, PrintPageEventArgs e)
		{
			try
			{
				PrinterHeight = e.PageBounds.Height;
				PrinterWidth = e.PageBounds.Width;
				PrinterColsVisible = (PrinterWidth - 80) / ColWidth;
				PrinterRowsVisible = (PrinterHeight - 30) / RowHeight;
				Bitmap B = new Bitmap(PrinterWidth, PrinterHeight);
				Graphics G = Graphics.FromImage(B);
				G.CompositingQuality = CompositingQuality.HighQuality;
				G.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit;
				DrawStoryboard(ref B, ref G, PrinterRowsVisible, PrinterColsVisible, PrinterTopRow, PrinterLeftCol);
				G.Dispose();
				e.Graphics.DrawImage(B, 0, 0);
				PrinterLeftCol += PrinterColsVisible;
				e.HasMorePages = true;
				if (PrinterLeftCol > colSceneIDs.Count)
				{
					PrinterTopRow += ColsVisible;
					if (PrinterTopRow > colRows.Count)
					{
						e.HasMorePages = false;
					}
					else
					{
						PrinterLeftCol = 1;
					}
				}
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
				ProjectData.ClearProjectError();
			}
		}

		private void PageSetupToolStripMenuItem_Click(object sender, EventArgs e)
		{
			try
			{
				if (PageSetupDialog1.ShowDialog() == DialogResult.OK)
				{
					PrintDialog1.PrinterSettings = PageSetupDialog1.PrinterSettings;
				}
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
				ProjectData.ClearProjectError();
			}
		}

		private void AboutPrintingToolStripMenuItem_Click(object sender, EventArgs e)
		{
			clsShared.cLang.TransMsgBox("Printing will use a lot of paper, since you'll only get 4-6 scenes across each page. I suggest using 'Print Preview' first.");
		}

		private void PrintPreviewToolStripMenuItem_Click(object sender, EventArgs e)
		{
			try
			{
				PrintPreviewDialog1.ShowDialog();
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
				clsShared.cLang.TransMsgBox("Print Preview failed. Please ensure you have at least one printer accessible from your computer.@1@@2@", MsgBoxStyle.Exclamation, "", "\r\n", ex2.Message);
				ProjectData.ClearProjectError();
			}
		}

		private void SelectFontToolStripMenuItem_Click(object sender, EventArgs e)
		{
			frmPickFont frmPickFont = new frmPickFont("StoryBoardFontName", "StoryBoardFontSize");
			frmPickFont.ShowDialog();
			if (frmPickFont.Saved)
			{
				RefreshStoryboard();
			}
		}

		private void SetupFont()
		{
			try
			{
				string familyName = clsShared.cSettings.sGet("StoryBoardFontName", "Arial");
				int num = (int)Math.Round(clsShared.cSettings.sGet("StoryBoardFontSize", 7));
				CardFont = new Font(familyName, num);
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
				ProjectData.ClearProjectError();
			}
		}

		private void AllCharactersToolStripMenuItem_Click(object sender, EventArgs e)
		{
			ShowWhat = eShowWhat.ShowAllChar;
			ScrollToTop();
			RefreshStoryboard();
		}

		private void ViewpointOnlyToolStripMenuItem_Click(object sender, EventArgs e)
		{
			ShowWhat = eShowWhat.ShowVPOnly;
			ScrollToTop();
			RefreshStoryboard();
		}

		private void UnTickAllShowWhat()
		{
			AllCharactersToolStripMenuItem.Checked = false;
			ViewpointOnlyToolStripMenuItem.Checked = false;
		}

		private void ViewToolStripMenuItem_Click(object sender, EventArgs e)
		{
		}

		private void ViewToolStripMenuItem_DropDownOpening(object sender, EventArgs e)
		{
			UnTickAllShowWhat();
			switch (ShowWhat)
			{
			case eShowWhat.ShowAllChar:
				AllCharactersToolStripMenuItem.Checked = true;
				break;
			case eShowWhat.ShowVPOnly:
				ViewpointOnlyToolStripMenuItem.Checked = true;
				break;
			}
			SmallerToolStripMenuItem.Checked = false;
			LargerToolStripMenuItem.Checked = false;
			NormalToolStripMenuItem.Checked = false;
			switch (CardSize)
			{
			case eSizes.Small:
				SmallerToolStripMenuItem.Checked = true;
				break;
			case eSizes.Medium:
				NormalToolStripMenuItem.Checked = true;
				break;
			case eSizes.Large:
				LargerToolStripMenuItem.Checked = true;
				break;
			}
		}

		private void ScrollToTop()
		{
			TopRow = 1;
			SuppressChange = true;
			VScrollBar1.Value = 1;
			SuppressChange = false;
		}

		private void EditSelectedSceneToolStripMenuItem_Click(object sender, EventArgs e)
		{
			int num = SceneIDUnderMouse();
			if (num > 0)
			{
				EditSceneEvent?.Invoke(num, 0);
			}
		}

		private void ctxCards_Opening(object sender, CancelEventArgs e)
		{
			if (SceneIDUnderMouse() <= 0)
			{
				e.Cancel = true;
			}
		}

		private void PrintPreviewDialog1_Load(object sender, EventArgs e)
		{
		}

		private void MenuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
		{
		}

		private void SmallerToolStripMenuItem_Click(object sender, EventArgs e)
		{
			SetCardSize(eSizes.Small);
		}

		private void NormalToolStripMenuItem_Click(object sender, EventArgs e)
		{
			SetCardSize(eSizes.Medium);
		}

		private void LargerToolStripMenuItem_Click(object sender, EventArgs e)
		{
			SetCardSize(eSizes.Large);
		}

		private void SetCardSize(eSizes eSize)
		{
			switch (eSize)
			{
			case eSizes.Small:
				CardWidth = 100;
				CardHeight = 90;
				break;
			case eSizes.Medium:
				CardWidth = 150;
				CardHeight = 120;
				break;
			case eSizes.Large:
				CardWidth = 220;
				CardHeight = 160;
				break;
			}
			RowHeight = CardHeight + 10;
			ColWidth = CardWidth + 14;
			clsShared.cSettings.sSet("CardSize", eSize);
			RefreshStoryboard();
		}
	}
}
